/*
 * Copyright 2012 yura.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.opu.db.obj.vis.domain.domains;

import java.io.Serializable;
import org.simpleframework.xml.Attribute;

/**
 *
 * @author yura
 */
public class PriorityId<Entity extends Serializable> 
        implements Serializable{
    
    // This field should be injected by ObjectEntry
    protected Entity entity;
    @Attribute
    protected String notion;

    public Entity getEntity() {
        return entity;
    }

    public void setEntity(Entity entity) {
        this.entity = entity;
    }

    public String getNotion() {
        return notion;
    }

    public void setNotion(String notion) {
        this.notion = notion;
    }

    @Override
    public int hashCode() {
        int hash = 3;
        hash = 17 * hash + (this.entity != null ? this.entity.hashCode() : 0);
        hash = 17 * hash + (this.notion != null ? this.notion.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final PriorityId<Entity> other = (PriorityId<Entity>) obj;
        if (this.entity != other.entity && (this.entity == null || !this.entity.equals(other.entity))) {
            return false;
        }
        if ((this.notion == null) ? (other.notion != null) : !this.notion.equals(other.notion)) {
            return false;
        }
        return true;
    }
}
